# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=gzip
pkgver=1.6
pkgrel=1
pkgdesc="GNU compression utility"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gzip/"
license=('GPL3')
groups=('base' 'compression')
depends=('msys2-runtime' 'bash' 'less')
install=gzip.install
source=(ftp://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz{,.sig}
        'gzip-1.6-fpending.patch'
        'gzip-1.6-msys2.patch')
md5sums=('da981f86677d58a106496e68de6f8995'
         'SKIP'
         '6a6f05c2ccc52a3958130998465b2724'
         'a8b37bd18819566f61a60271ec3201cc')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}

  patch -p1 -i ${srcdir}/gzip-1.6-fpending.patch
  patch -p1 -i ${srcdir}/gzip-1.6-msys2.patch
  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --build=${CHOST} --prefix=/usr
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
